package com.wss.day06.regex;

import java.lang.reflect.Array;
import java.util.Arrays;

/**2.使用正则表达式切割字符串
 192.168.105.27 按照  . 号切割字符串
 18 22 40 65 按照空格切割字符串
 * @author wangshaoshuai
 * @desc TODO
 * @date 2025/4/25
 */
public class Test2 {
    public static void main(String[] args) {
        String string = "192.168.105.27";
        String[] str1 = string.split("\\.");
        System.out.println(Arrays.toString(str1));

        String string1 = "18   22  40   65";
        String[] strArray = string1.split("  +");
        for (int i = 0; i < strArray.length; i++) {

            System.out.println(strArray[i]);
        }
    }
}
